const express = require('express');
const router = express.Router();

router.get('/forCurrentUser', (req, res) => {
    const content = [];
    for(let i = 0; i < 40; i++) content.push({
        id: `${i + 1}`,
        code: 'string',
        name: 'string',
        shortCode: 'string',
        shortName: 'string',
        country: 'string',
        province: 'string',
        city: 'string',
        contactNumber: 'string',
        address: 'string',
        agentKind: 21,
        rowVersion: 'string',
        options: [
            'update',
        ]
    });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 40,
        }
    });
});
router.get('/:id', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                id: '1',
                brandId: '',
                code: 'string',
                name: 'string',
                shortCode: 'string',
                shortName: 'string',
                country: 'string',
                province: 'string',
                city: 'string',
                contactNumber: 'string',
                address: 'string',
                fax: 'string',
                zipCode: 'string',
                agentKind: 21,
                rowVersion: 'string',
                options: [
                    'update',
                ],
                dealerResourceLists: [
                    {
                        id: 'string',
                        lV1Code: 'string',
                        lV1Name: 'string',
                        lV2Code: 'string',
                        lV2Name: 'string',
                        lV3Code: 'string',
                        lV3Name: 'string',
                        lV4Code: 'string',
                        lV4Name: 'string',
                        productCode: 'string',
                        productName: 'string'
                    }
                ]
            }
        }
    );
});

router.put('/:id', (req, res) => {
    res.json({
        message: '编辑成功'
    });
});
router.get('/export', (req, res) => {
    res.json({
        message: '导出成功',
        payload: 'Mock导出'
    });
});
router.post('/import', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});

module.exports = router;
